<template>
  <el-form  ref="ruleFormRef" :model="formInline" :rules="formRules" label-width="auto" label-position="top" v-loading="isLoading">
    <el-row :gutter="30">

			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.id' prop='id'>
					<el-input v-model.trim='formInline.id' clearable :placeholder='prompt?.id' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.projectName' prop='projectName'>
					<el-input v-model.trim='formInline.projectName' clearable :placeholder='prompt?.projectName' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.modelName' prop='modelName'>
					<el-input v-model.trim='formInline.modelName' clearable :placeholder='prompt?.modelName' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.deviceId' prop='deviceId'>
					<el-input v-model.trim='formInline.deviceId' clearable :placeholder='prompt?.deviceId' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.flowCardNum' prop='flowCardNum'>
					<el-input v-model.trim='formInline.flowCardNum' clearable :placeholder='prompt?.flowCardNum' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.ICCID' prop='ICCID'>
					<el-input v-model.trim='formInline.ICCID' clearable :placeholder='prompt?.ICCID' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.status' prop='status'>
					<el-input v-model.trim='formInline.status' clearable :placeholder='prompt?.status' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.operator' prop='operator'>
					<el-input v-model.trim='formInline.operator' clearable :placeholder='prompt?.operator' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.lastFlow' prop='lastFlow'>
					<el-input v-model.trim='formInline.lastFlow' clearable :placeholder='prompt?.lastFlow' />
				</el-form-item>
			</re-col>
			<re-col :value='12' :xs='24' :sm='24'>
				<el-form-item :label='titles?.activeDate' prop='activeDate'>
					<el-input v-model.trim='formInline.activeDate' clearable :placeholder='prompt?.activeDate' />
				</el-form-item>
			</re-col>    </el-row>
  </el-form>
</template>

<script setup lang="ts">
import { ref,reactive } from "vue";
import ReCol from "@/components/ReCol";
import type { FormRules } from "element-plus";
import { titles,prompt } from './index';
import type { infoType } from '@/api/operate/device-management/traffic-card/index';
type FormProps = {
	formInline: infoType,
	isLoading: boolean
}

const props = withDefaults(defineProps<FormProps>(), {
	formInline: () => ({} as infoType),
	isLoading: false
});

const formRules = reactive(<FormRules>{id: [{ required: true, message: prompt?.id, trigger: 'blur' },],
projectName: [{ required: true, message: prompt?.projectName, trigger: 'blur' },],
modelName: [{ required: true, message: prompt?.modelName, trigger: 'blur' },],
deviceId: [{ required: true, message: prompt?.deviceId, trigger: 'blur' },],
flowCardNum: [{ required: true, message: prompt?.flowCardNum, trigger: 'blur' },],
ICCID: [{ required: true, message: prompt?.ICCID, trigger: 'blur' },],
status: [{ required: true, message: prompt?.status, trigger: 'blur' },],
operator: [{ required: true, message: prompt?.operator, trigger: 'blur' },],
lastFlow: [{ required: true, message: prompt?.lastFlow, trigger: 'blur' },],
activeDate: [{ required: true, message: prompt?.activeDate, trigger: 'blur' },],
});
const ruleFormRef = ref();
//    const newFormInline = ref(props.formInline as any);
//
//
//    watch(()=>props.formInline,()=>{
//    	newFormInline.value = props.formInline
//    },{
//    	deep:true,
//    	immediate:true
//    })
function getRef() {
  return ruleFormRef.value;
}

defineExpose({ getRef });
</script>
